/*************************************************************************
	> File Name: P1832.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-04-16 15:49:12
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 1000
int prime[MAX_N + 5];
long long dp[MAX_N + 5];
void init() {
    for (int i = 2; i <= MAX_N; i++) {
        if (prime[i]) continue;
        prime[++prime[0]] = i;
        for (int j = i, I = MAX_N / i; j <= I; j++) {
            prime[i * j] = 1;
        }
    }
    return ;
}

int main() {
    init();
    int n;
    cin >> n;
    dp[0] = 1;
    for (int i = 1; i <= prime[0] && prime[i] <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (j >= prime[i]) {
                dp[j] += dp[j - prime[i]];
            }
        }
    }
    cout << dp[n] << endl;
    return 0;
}
